﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Base
{
    /// <summary>
    /// 通信客户端初始化参数基类
    /// </summary>
    public abstract class ClientInitParaAbs : IClientInitPara
    {
        /// <summary>
        /// 分包器
        /// </summary>
        public IUnpacker Unpacker { get; private set; }

        /// <summary>
        /// 接收数据模式
        /// </summary>
        public virtual ThreadMode ReceiveDataMode { get; set; } = ThreadMode.Async;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="unpacker">分包器</param>
        public ClientInitParaAbs(IUnpacker unpacker)
        {
            if (unpacker == null)
            {
                throw new ArgumentNullException(nameof(unpacker));
            }

            this.Unpacker = unpacker;
        }
    }
}
